﻿using System;
using System.ServiceModel.Description;
using System.Collections.ObjectModel;
using System.ServiceModel.Channels;
using System.ServiceModel;

namespace Axium.Services.Behavior
{
    /// <summary>
    /// It is extras. There is no needs to use it if you will map you domain model 'Axium.Model.SomeModel' 
    /// to data contact 'Axium.Contracts.Data.SomeItem' manualy.
    /// </summary>
    public class AutomapServiceBehavior : Attribute, IServiceBehavior
    {

        public void AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase,
            Collection<ServiceEndpoint> endpoints, BindingParameterCollection bindingParameters)
        {
        }

        public void ApplyDispatchBehavior(ServiceDescription serviceDescription, System.ServiceModel.ServiceHostBase serviceHostBase)
        {
            AutomapBootstrap.InitializeMap();
        }

        public void Validate(ServiceDescription serviceDescription, System.ServiceModel.ServiceHostBase serviceHostBase)
        {
        }
    }
}
